package com.wen.Part5;

import printer.BinaryTreeInfo;

public class CharNode implements BinaryTreeInfo {


    public char val;
    public CharNode left;
    public CharNode right;

    public CharNode(char val) {
        this.val = val;
    }

    @Override
    public String toString() {
        return "TreeNode{" +
                "val=" + val +
                '}';
    }

    @Override
    public Object root() {
        return this;
    }

    @Override
    public Object left(Object node) {
        return ((CharNode)node).left;
    }

    @Override
    public Object right(Object node) {
        return ((CharNode)node).right;
    }

    @Override
    public Object string(Object node) {
        return ((CharNode)node).val;
    }
}
